﻿using System.Linq;
using INHollandair.Core.Models;
using INHollandair.Core.Repositories;


namespace INHollandair.Core.Services
{
    public class BlockedIpService
    {
        private readonly BlockedIpRepository _repo = new BlockedIpRepository();

        public BlockedIp GetBlockedIpByIp(string ip)
        {
            return _repo.BlockedIpRepo.FirstOrDefault(x => x.Ip.Equals(ip));
        }

        public void InsertBlockedIp(BlockedIp blockedIp)
        {
            _repo.InsertBlockedIp(blockedIp);
        }
        public void UpdateBlockedIp(BlockedIp blockedIp)
        {
            _repo.UpdateBlockedIp(blockedIp);
        }
        public void RemoveBlockedIp(BlockedIp blockedIp)
        {
            _repo.RemoveBlockedIp(blockedIp);
        }

    }
}
